<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<title> 在线人才招聘系统</title>
	<meta charset = 'utf-8'>
	<!-- 新 Bootstrap 核心 CSS 文件 -->
	<link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
	
	<!-- 登录模态框 -->
	<div class="modal fade" id="loginModal">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
	        <h4 class="modal-title">登录</h4>
	      </div>

	      <div class="modal-body">
	        <form role="form" action="login" method="post">

			  <div class="form-group">
			    <label for="username">用户名</label>
			    <input type="text" class="form-control" id="username" name="username" placeholder="请输入用户名">
			  </div>

			  <div class="form-group">
			    <label for="password">密码</label>
			    <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码">
			  </div>

			<div class="form-group" id="utypeDiv">
				<label for="utype">用户类型</label>
				<select class="form-control" id="utype" name="utype">
					<option>个人用户</option>
					<option>企业用户</option>
				</select>
			</div>
			  <button type="submit" class="btn btn-success">登录</button>
			  <a href = "registerPerson.jsp" class="btn btn-primary" >个人注册</a>
			  <a href = "registerEnterprise.jsp" class="btn btn-primary" >企业入驻</a>
			</form>
	      </div>

	      <div class="modal-footer">
	        <button type="button" class="btn btn-danger" data-dismiss="modal">取消</button>
	      </div>
	    </div><!-- /.modal-content -->
	  </div><!-- /.modal-dialog -->
	</div><!-- /.modal -->

	<nav class="navbar navbar-inverse" role="navigation">
	  <div class="container-fluid">
	    <!-- Brand and toggle get grouped for better mobile display -->
	    <div class="navbar-header">
	      <a class="navbar-brand" href="index.jsp" class="active">
	      	<span class="glyphicon glyphicon-home"></span>
	      </a>
	    </div>

	    <!-- Collect the nav links, forms, and other content for toggling -->
	    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
	      <ul class="nav navbar-nav">
	        
	      </ul>
	      <ul class="nav navbar-nav">
	        	<%
	        		String username = (String)session.getAttribute("username");
	        		String utype = (String)session.getAttribute("utype");
	        		if (username!=null&&utype.equals("enterprise")) 
	        		{
	        	%>
			        <li><a href="enterprise.jsp">企业板块</a></li>
	        		
	        	<%
	        		}
	        		else if(username!=null&&utype.equals("person"))
	        		{
	        	%>
					<li><a href="person.jsp">个人板块</a></li>
	        	<%
	        		}
	        		else
	        		{
	        	%>
	        			<li><a href="#">在线招聘系统</a></li>
	        	<%
					}
	        	%>
	      </ul>
	      

	      <ul class="nav navbar-nav navbar-right">
	        <li>
	        	<%
	        		username = (String)session.getAttribute("username");
	        		if (username==null) 
	        		{

	        	%>
	        		<a data-toggle="modal" href="#loginModal">登录</a>
	
	        	<%
	        		}
	        		else
	        		{
	        	%>
	        		<a>欢迎您,<%=username%></a>
	        		</li>
	        		<li>
	        		<a href="#" id="logout">退出</a>
	        	<%
					}
	        	%>
	        </li>
	        
	      </ul>
	    </div><!-- /.navbar-collapse -->
	  </div><!-- /.container-fluid -->
	</nav>
	
	<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	<script src="js/jquery.min.js"></script>

	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="js/bootstrap.min.js"></script>
	<script src="js/logout.js"></script>
</body>
</html>